package com.momo.todo.utils;

import android.content.Context;
import android.util.Log;
import android.widget.Toast;

import java.util.List;

/**
 * Created by Administrator on 2016/10/25.
 */

public class LogUtils {
    private static boolean debugMode = true;
    private static String tag = "mytag";

    public static void log(String s){
        if(debugMode){
            Log.d(tag,s);
        }
    }

    public static void logList(List list){
        for(int i=0;i<list.size();i++){
            log(list.get(i).toString()+"\n");
        }
    }

    public static void toast(Context context , String s){
        if(debugMode){
            Toast.makeText(context, s, Toast.LENGTH_SHORT).show();
        }
    }

    public void setDebug(boolean debug) {
        this.debugMode = debug;
    }

    public boolean isDebug() {

        return debugMode;
    }
}
